import request from '@/utils/request'
import { getToken } from '@/utils/token'
export const loginAPI = ({ mobile, code }) => request({
  url: '/v1_0/authorizations',
  method: 'POST',
  data: {
    mobile: mobile,
    code: code
  }
})
export const getUserChannelListAPI = () => request({
  url: '/v1_0/user/channels',
  headers: {
    Authorization: `Bearer ${getToken()}`
  }
})
export const getChannelListAPI = () => request({
  url: '/v1_0/channels'
})
export const getArticleListAPI = (channel_id) => request({
  url: '/v1_0/articles',
  method: 'GET',
  headers: {
    Authorization: `Bearer ${getToken()}`
  },
  params: {
    channel_id: channel_id,
    timestamp: new Date()
  }
})
